<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use \Illuminate\Routing\Router;
use App\Http\Controllers\Guard\Login\LoginController;
use App\Http\Controllers\Guard\Rbac\PermissionController;
use App\Http\Controllers\Guard\Rbac\GuardUserController;
use App\Http\Controllers\Guard\Rbac\RoleController;
use App\Http\Controllers\Guard\Site\SettingController;
use App\Http\Controllers\Guard\Car\UserController;
use App\Http\Controllers\Guard\Car\CarInfoController;
use App\Http\Controllers\Guard\Car\OrderController;
use App\Http\Controllers\Guard\Car\FixCarOrderController;
use App\Http\Controllers\Guard\Car\RentUnitController;
use App\Http\Controllers\Guard\Car\IndexController;



/****************************************** guard ************************************************/

//登录
Route::match(['get','post'],'/login',[LoginController::class,'login']);
Route::get('/getToken',[LoginController::class,'getToken']);
Route::get('/logout',[LoginController::class,'logout']);
Route::get('/changeCol',[LoginController::class,'changeCol']);
Route::post('/upload',[LoginController::class,'upload']);
Route::post('/upload2',[LoginController::class,'upload2']);
Route::get('/getVerifyCodeImg',[LoginController::class,'getVerifyCodeImg']);
Route::get('/getArea',[LoginController::class,'getArea']);
Route::get('/download',[LoginController::class,'download']);

Route::post('/importFile',[LoginController::class,'importFile']);

//rbac权限管理
Route::group(['prefix'=>'rbac'],function(Router $router){

    $router->get('/getGuardUser',[IndexController::class,'getGuardUser']);
    $router->get('/loginLog',[IndexController::class,'loginLog']);

    $router->match(['get','post'],'/permission/lst',[PermissionController::class,'lst']);
    $router->match(['get','post'],'/permission/add',[PermissionController::class,'add']);
    $router->get('/permission/detail',[PermissionController::class,'detail']);
    $router->get('/permission/del',[PermissionController::class,'del']);

    $router->get('/role/lst',[RoleController::class,'lst']);
    $router->match(['get','post'],'/role/add',[RoleController::class,'add']);
    $router->get('/role/del',[RoleController::class,'del']);
    $router->get('/role/detail',[RoleController::class,'detail']);

    $router->get('/guardUser/getPermission',[GuardUserController::class,'getPermission']);
    $router->get('/guardUser/lst',[GuardUserController::class,'lst']);
    $router->match(['get','post'],'/guardUser/add',[GuardUserController::class,'add']);
    $router->get('/guardUser/detail',[GuardUserController::class,'detail']);
    $router->get('/guardUser/getUserByToken',[GuardUserController::class,'getUserByToken']);
    $router->get('/guardUser/del',[GuardUserController::class,'del']);
    $router->post('/guardUser/edit',[GuardUserController::class,'edit']);
    $router->post('/guardUser/resetPassword',[GuardUserController::class,'resetPassword']);
    $router->post('/guardUser/coverPassword',[GuardUserController::class,'coverPassword']);
});

//订单信息
Route::group(['prefix'=>'order'],function(Router $router){
    $router->get('/lst',[OrderController::class,'lst']);
    $router->post('/add',[OrderController::class,'add']);
    $router->get('/change',[OrderController::class,'change']);
    $router->get('/detail',[OrderController::class,'detail']);
    $router->get('/del',[OrderController::class,'del']);
    $router->get('/getFreeCarLst',[OrderController::class,'getFreeCarLst']);
    $router->get('/getAllCarLst',[OrderController::class,'getAllCarLst']);
    $router->post('/backCar',[OrderController::class,'backCar']);
});

//修车订单信息
Route::group(['prefix'=>'fixcarorder'],function(Router $router){
    $router->get('/lst',[FixCarOrderController::class,'lst']);
    $router->get('/detail',[FixCarOrderController::class,'detail']);
    $router->get('/del',[FixCarOrderController::class,'del']);
    $router->post('/add',[FixCarOrderController::class,'add']);
});

//车辆信息
Route::group(['prefix'=>'carinfo'],function(Router $router){
    $router->get('/lst',[CarInfoController::class,'lst']);
    $router->get('/insuranceLst',[CarInfoController::class,'insuranceLst']);
    $router->get('/fixLst',[CarInfoController::class,'fixLst']);
    $router->post('/add',[CarInfoController::class,'add']);
    $router->get('/change',[CarInfoController::class,'change']);
    $router->get('/detail',[CarInfoController::class,'detail']);
    $router->get('/del',[CarInfoController::class,'del']);
    $router->get('/buyInsurance',[CarInfoController::class,'buyInsurance']);
});

//外租单位
Route::group(['prefix'=>'rentunit'],function(Router $router){
    $router->get('/lst',[RentUnitController::class,'lst']);
    $router->post('/add',[RentUnitController::class,'add']);
    $router->get('/change',[RentUnitController::class,'change']);
    $router->get('/del',[RentUnitController::class,'del']);
    $router->get('/detail',[RentUnitController::class,'detail']);
});

//统计信息
Route::group(['prefix'=>'count'],function(Router $router){

    $router->get('/getCountCarInfo',[IndexController::class,'getCountCarInfo']);
    $router->get('/getCountRentInfo',[IndexController::class,'getCountRentInfo']);

});


//系统设置
Route::group(['prefix'=>'site'],function(Router $router){

    $router->match(['get','post'],'/setting/index',[SettingController::class,'index']);

});


//用户管理
Route::group(['prefix'=>'user'],function(Router $router){

    $router->get('/lst',[UserController::class,'lst']);
    $router->get('/detail',[UserController::class,'detail']);
    $router->get('/del',[UserController::class,'del']);
    $router->match(['get','post'],'/add',[UserController::class,'add']);

});






